﻿namespace Leetcode.N0191;

public class Solution
{
    public int HammingWeight(uint n)
    {
        int c = 0;
        while (n > 0)
        {
            n &= n - 1;
            c++;
        }
        return c;
    }
}
